import java.sql.Connection;
import java.util.Calendar;
import java.util.List;

public abstract class DepositManager {

	final double bank_constant_interest = 6.0;
	final double dollar_foreign_rate = 0.04;
	final double deposit_penatly = 5;
	private PropertyDBManager propertyDBManager;
	private DepositTypesDBManager depositTypesDBManager;
	private BalanceDBManager balanceDBManager;
	private AccountDBManager accountDBManager;
	private Connection connection;

	public DepositManager(Connection initConnection, PropertyDBManager propertyDBManager, DepositTypesDBManager depositTypesDBManager, BalanceDBManager balanceDBManager, AccountDBManager accountDBManager) {
		// constructor - initialiaze connection
		// use this connection in all functions of AccountManager

		setConnection(initConnection);
		setDepositTypesDBManager(depositTypesDBManager);
		setPropertyDBManager(propertyDBManager);
		setBalanceDBManager(balanceDBManager);
		setAccountDBManager(accountDBManager);
	}

	public BalanceDBManager getBalanceDBManager() {
		return balanceDBManager;
	}

	public void setBalanceDBManager(BalanceDBManager balanceDBManager) {
		this.balanceDBManager = balanceDBManager;
	}

	public AccountDBManager getAccountDBManager() {
		return accountDBManager;
	}

	public void setAccountDBManager(AccountDBManager accountDBManager) {
		this.accountDBManager = accountDBManager;
	}

	public PropertyDBManager getPropertyDBManager() {
		return propertyDBManager;
	}

	public void setPropertyDBManager(PropertyDBManager propertyDBManager) {
		this.propertyDBManager = propertyDBManager;
	}

	public DepositTypesDBManager getDepositTypesDBManager() {
		return depositTypesDBManager;
	}

	public void setDepositTypesDBManager(DepositTypesDBManager depositTypesDBManager) {
		this.depositTypesDBManager = depositTypesDBManager;
	}

	public Connection getConnection() {
		return connection;
	}

	public void setConnection(Connection connection) {
		this.connection = connection;
	}

	public abstract boolean addDeposit(Deposit deposit) throws DBManagerException;

	public abstract boolean drawDeposit(Deposit deposit) throws DBManagerException;

	public abstract boolean updateDeposit(Deposit deposit) throws DBManagerException;

	public abstract boolean calcEstimatedAmount(Deposit deposit, Calendar calcDate) throws DBManagerException;

	public abstract Deposit calcFinalEstimatedAmount(Deposit deposit) throws DBManagerException;

	public abstract List getDepositByCustId(long custId);

	public abstract Deposit getDepositById(long depositId) throws DBManagerException;

	public abstract boolean deleteDeposit(Long depositId) throws DBManagerException;

}